import { App } from "vue";
import directive from "@/directives/index";
import filters from "@/filters/index";
import components from "@/components/components_use";
import imgCatelog from "@/assets/img/catelog";
import { gbUrl } from "@/util/util";

export default {
  install: (app: App): void => {
    app.config.globalProperties.$filters = filters;
    app.config.globalProperties.$gbUrl = gbUrl;
    app.config.globalProperties.$imgCatelog = imgCatelog;

    Object.keys(directive).forEach(m => {
      app.directive(m, directive[m as keyof typeof directive]);
    });

    Object.values(components).forEach(m => {
      app.component(m.name, m);
    });
  }
};
